
var bXmlHttpSupport = (typeof XMLHttpRequest != "undefined" ||window.ActiveXObject);
     
if (typeof XMLHttpRequest == "undefined" && window.ActiveXObject) {
	function XMLHttpRequest() {
    var arrSignatures = ["MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0",
    "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP",
    "Microsoft.XMLHTTP"];
                             
    	for (var i=0; i < arrSignatures.length; i++) {
    		try {        
        		var oRequest = new ActiveXObject(arrSignatures[i]);            
            	return oRequest;        
        	} catch (oError) { /*ignore*/ }
    	}          
    
    	throw new Error("MSXML is not installed on your system.");               
    }
}    
            
function query(obj) {        
	//var input = obj.parentNode.previousSibling.firstChild;
	var input = obj.parentNode.firstChild;
	var queryInfo = input.value;
	
	//var queryInfoInput = document.getElementById('queryInfo');
	//var queryInfo = queryInfoInput.value;
	if(bXmlHttpSupport) {
		var sUrl = 'avCmain/query?queryInfo='+queryInfo;
		var oRequest = new XMLHttpRequest();
		oRequest.onreadystatechange = function() {
			if(oRequest.readyState == 4) {
				var resultObj = eval('(' + oRequest.responseText + ')');
				var info = document.getElementById("info");
				info.innerHTML = resultObj.result;
			}
		};
		oRequest.open('POST', sUrl);
		oRequest.send(null);
	}
}
